Skip to content

fix: KeyboardAvoidingView incorrect layout#954

Merged
kirillzyusko merged 1 commit intomainfrom
fix/keyboard-avoiding-view-incorrect-layout
May 26, 2025
Merged

fix: KeyboardAvoidingView incorrect layout#954
kirillzyusko merged 1 commit intomainfrom
fix/keyboard-avoiding-view-incorrect-layout

Conversation

@kirillzyusko
Copy link
Copy Markdown
Owner

@kirillzyusko kirillzyusko commented May 23, 2025

📜 Description

Don't allow height to be 0 when KeyboardAvoidingView has behavior="height".

💡 Motivation and Context

The problem is that when we apply {height: 0} and then apply {}, then view doesn't reset its styles.

To overcome that problem I decided to avoid cases when we apply non-positive height (i. e. <= 0).

Closes #949

📢 Changelog

JS

  • add height > 0 condition;

🤔 How Has This Been Tested?

Tested in example app.

📸 Screenshots (if appropriate):

Before After
Screen.Recording.2025-05-23.at.19.12.55.mov
Screen.Recording.2025-05-23.at.19.11.37.mov

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@github-actions
Copy link
Copy Markdown
Contributor

📊 Package size report

Current size Target Size Difference
199716 bytes 199639 bytes 77 bytes 📈

@kirillzyusko kirillzyusko self-assigned this May 25, 2025
@kirillzyusko kirillzyusko added 🐛 bug Something isn't working KeyboardAvoidingView 🧪 Anything related to KeyboardAvoidingView component labels May 25, 2025
@kirillzyusko kirillzyusko marked this pull request as ready for review May 25, 2025 18:25
@kirillzyusko kirillzyusko merged commit e431917 into main May 26, 2025
12 checks passed
@kirillzyusko kirillzyusko deleted the fix/keyboard-avoiding-view-incorrect-layout branch May 26, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working KeyboardAvoidingView 🧪 Anything related to KeyboardAvoidingView component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeyboardAvoidingView with behavior="height" produces incorrect layout when navigating through a stack of screens with auto-focused inputs.

1 participant